package com.xbongbong.paas.feign;

import com.xbongbong.paas.pojo.workflow.operate.dto.WorkflowApproveFailedDTO;
import com.xbongbong.paas.pojo.workflow.operate.dto.WorkflowUpdateBackDTO;
import com.xbongbong.paas.toolbox.wrap.BaseVO;
import com.xbongbong.paas.toolbox.wrap.XbbResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author 吴峰
 * @date 2022/08/23 10:56
 */
@FeignClient(name = "pro-web-workflow-consumer", contextId = "workflowOperatorDataFeignClient")
public interface WorkflowDataProcessFeignClient {

    /**
     * 审批失败（拒绝，回退）
     * @param workflowApproveFailedDTO
     * @param lang 国际化 i18n 参数
     * @return
     * @throws
     * @author 吴峰
     * @date 2022/8/23 11:13
     * @throws
     */
    @RequestMapping(value = "/pro/v1/strategy/approvalFailed", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    XbbResponse<BaseVO> approvalFailed(@RequestBody WorkflowApproveFailedDTO workflowApproveFailedDTO, @RequestParam("lang") String lang);

    /**
     * 审批回退
     * @param workflowUpdateBackDTO
     * @param lang
     * @return
     */
    @RequestMapping(value = "/pro/v1/strategy/updateBack", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    XbbResponse<BaseVO> updateBack(@RequestBody WorkflowUpdateBackDTO workflowUpdateBackDTO, @RequestParam("lang") String lang);

}
